package org.needcoke.hs.config;

import lombok.Data;
import org.needcoke.hs.signature.*;

/**
 * 签名配置类
 */
@Data
public class SignatureConfig {

    private String url;

    private String useConfigName;

    /**
     * 签名连接符
     */
    private String connectorBetweenTwoGroup;

    /**
     * name 和 key 之间的连接符
     */
    private String connectorBetweenNameAndValue;

    /**
     * 排序算法
     */
    private SortedFunction sortedFunction;

    /**
     * 是否拼接表单类型的参数   --- 不含文本类型
     */
    private boolean doNotWithFormBody;

    /**
     * 是否需要拼接 application/json   application/xml等类型的body
     */
    private boolean doNotWithApplicationBody;

    /**
     * 链接参数和表单参数的位置关系
     */
    private SignParamLocation signParamLocation;

    /**
     * 签名放在什么位置
     * <p>
     * 0   ---   header
     * <p>
     * 1   ---    parameter
     */
    private int signatureField;

    /**
     * 默认的签名算法
     */
    private SignAlgorithm signAlgorithm;

    /**
     * 签名算法
     */
    private SignFunction signFunction;

    /**
     * 签名编码
     */
    private SignCode signCode;

    /**
     * 签名的名称
     */
    private String signatureName;

    /**
     * 需要拼接的指定串
     */
    private String key;


    protected String connectorBetweenBodyAndParam = "";

    protected boolean bodyBefore = false;

    protected String prefix = "";

    protected String suffix = "";

}
